package com.nsn.das.midas.model.component.change;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.nsn.das.midas.model.BaseEntity;
import com.nsn.das.midas.model.component.RevisionHistory;
import com.nsn.das.midas.model.mml.data.MMLProgramData;

@SuppressWarnings("serial")
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="Discriminator",discriminatorType =DiscriminatorType.STRING,length=30)
@Table(name="change_text")
public abstract class BaseChange extends BaseEntity{
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="program_id")
	private MMLProgramData program;
	@OneToMany(fetch=FetchType.LAZY)
	private List<RevisionHistory> histories;
	private Date createdAt;
	private String additionalInfo;
	private String feature;//ICDFeature;
	private String reportId;//ICDProblemReportID;
	private boolean checked;//ICDChecked;
	@Column(columnDefinition="TEXT")
	private String changeDescription;//CPOCDPODescription
	@Column(columnDefinition="TEXT")
	private String oldText;//CETCDOldErrorText
	@Column(columnDefinition="TEXT")
	private String newText;//CETCDNewErrorText
	private boolean commandStillWorks;//CSCDWorks
	//ICDOTFeature
	//ICDOTFeatureNumber
	
	public MMLProgramData getProgram() {
		return program;
	}
	public void setProgram(MMLProgramData program) {
		this.program = program;
	}
	public List<RevisionHistory> getHistories() {
		return histories;
	}
	public void setHistories(List<RevisionHistory> histories) {
		this.histories = histories;
	}
	public Date getCreatedAt() {
		return createdAt;
	}
	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}
	public String getAdditionalInfo() {
		return additionalInfo;
	}
	public void setAdditionalInfo(String additionalInfo) {
		this.additionalInfo = additionalInfo;
	}
	public String getFeature() {
		return feature;
	}
	public void setFeature(String feature) {
		this.feature = feature;
	}
	public String getReportId() {
		return reportId;
	}
	public void setReportId(String reportId) {
		this.reportId = reportId;
	}
	public boolean isChecked() {
		return checked;
	}
	public void setChecked(boolean checked) {
		this.checked = checked;
	}
	public String getChangeDescription() {
		return changeDescription;
	}
	public void setChangeDescription(String changeDescription) {
		this.changeDescription = changeDescription;
	}
	public String getOldText() {
		return oldText;
	}
	public void setOldText(String oldText) {
		this.oldText = oldText;
	}
	public String getNewText() {
		return newText;
	}
	public void setNewText(String newText) {
		this.newText = newText;
	}

	public boolean isCommandStillWorks() {
		return commandStillWorks;
	}

	public void setCommandStillWorks(boolean commandStillWorks) {
		this.commandStillWorks = commandStillWorks;
	}
}
